﻿using System;
using System.Collections.Generic;
using System.Text;
using SEO.Model;
using SEO.DAL;

namespace SEO.BLL
{
    /// <summary>
    /// 版权所有: 版权所有(C) 2011，Adin Lee
    /// 内容摘要: ESEmailsBLL
    /// 完成日期：2011年9月15日
    /// 版    本：V1.0 
    /// 作    者：Adin
    /// </summary>
    public class ESEmailsBLL
    {
        ESEmailsDAL iyDAL = new ESEmailsDAL();

        /// <summary>
        /// 获取ESEmails表中所有数据
        /// <returns>返回List类型</returns>
        /// </summary>
        public List<ESEmails> GetAllESEmailsBLL()
        {
            return iyDAL.GetAllESEmailsDAL();
        }

        /// <summary>
        /// 根据传入的SQL语句获取ESEmails表中数据
        /// </summary>
        /// <param name="strSql">SQL语句</param>
        /// <returns>返回List类型</returns>
        public List<ESEmails> GetESEmailsByWhereBLL(string strSql)
        {
            return iyDAL.GetESEmailsByWhereDAL(strSql);
        }

        /// <summary>
        /// 往ESEmails表中插入数据
        /// </summary>
        /// <returns>返回插入条数</returns>
        public int InsertESEmailsBLL(SEO.Model.ESEmails ks)
        {
            return iyDAL.InsertESEmailsDAL(ks);
        }

        /// <summary>
        /// 根据ID更新ESEmails表中数据
        /// </summary>
        /// <param name="ks">实例化ESEmails类</param>
        /// <returns>返回更新条数</returns>
        public int UpdateESEmailsBLL(SEO.Model.ESEmails ks)
        {
            return iyDAL.UpdateESEmailsDAL(ks);
        }

        /// <summary>
        /// 根据指定条件删除ESEmails表中数据
        /// <param name="strSql">SQL语句</param>
        /// <returns>返回删除条数</returns>
        public int DeleteESEmailsBLL(string strSql)
        {
            return iyDAL.DeleteESEmailsDAL(strSql);
        }

        /// <summary>
        /// 绑定表ESEmails到DataGridView
        /// <param name="dgv">DataGridView控件名称</param>
        /// <param name="strSql">SQL语句</param>
        /// </summary>
        public void BindESEmailsBLL(System.Windows.Forms.DataGridView dgv, string strSql)
        {
            iyDAL.BindESEmailsDAL(dgv, strSql);
        }

        public void BindServerEmailsBLL(System.Windows.Forms.DataGridView dgv, string strSql)
        {
            iyDAL.BindServerEmailsDAL(dgv, strSql);
        }
    }
}
